﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="OrgTree_Other_Edit.aspx.cs" Inherits="SysManage_OrgTree_Other_Edit" %>


<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
 <title>部门编辑</title>
    <base target ="_self" />
    <link rel="stylesheet" href="../css/css.css" type="text/css" />
    <!--#include file="../JS/KeyControlCode.js"-->
    <!--#include file="../JS/TrimData.js"--> 
    <!--#include file="../JS/TDTextBoxControl.js"--> 
    <!--#include file="../JS/MyKeyCode.js"-->
    
     <script language ="javascript" type ="text/javascript" >
     <!--
      /////调用人员选择树      
      //选择人员信息
      var sChoiceID;              //所在赋值的关键字  
      var ChoiceNameInfo;         //选择的名称集合
      var ChoiceIDInfo;           //选择的ID集合
      var iChoicePoNumber1 =1;     //0表示任意多,其它的正整数为可以选择的最大个数.不可以为负数
      function GetMyPersTree(obj)
      {
         var sFeatures = "dialogHeight:600px;dialogWidth:700px;resizeable:no;help:no;status:no";
         var obj = showModalDialog("ChoicePersInfo.aspx?ChoiceID="+obj+"&OrgType=2&OrgIDCol=0",window,sFeatures);
         if(obj != undefined)
         {
             sChoiceID = obj.sChoiceID;
             ChoiceNameInfo = obj.ChoiceNameInfo;
             ChoiceIDInfo=obj.ChoiceIDInfo;
             eval("form1.ChoiceName_"+sChoiceID+".value="+ChoiceNameInfo+";");
             eval("form1.HChoiceID_"+sChoiceID+".value="+ChoiceIDInfo+";"); 
             eval("form1.ChoiceName_"+sChoiceID+".blur()");
         }
      }
      -->
    </script>
</head>
<body leftmargin ="0" rightmargin ="0" topmargin ="0"  style =" background-image :url('../images/hit_bg.gif');">
<% 
  Response .ExpiresAbsolute=System.DateTime.Now. AddSeconds(-1);
  Response.Expires=0;
  Response.CacheControl = "no-cache";
%>
    <form id="form1" method ="post" runat="server">
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="15%" height="18" valign="top" background="../images/tablelb.gif" class="font13"> 
      <div align="left"><img height=18 src="../images/tablelbleft.gif" width=18></div></td>
    <td width="2%" valign="top" background="../images/tablelb.gif" bgcolor="#ffffff" class="font13"> 
      <div align="right"><img height=18 src="../images/tablelbright.gif" width=12></div></td>
    <td colspan="2" valign="center" bgcolor="#ffffff" class="font13"> <div align="right"> 
      </div></td>
  </tr>
  <tr> 
    <td height="26" colspan="2" valign="center" bgcolor="#e9ecf5" class="font13"> 
      <div align="center">组织管理</div></td>
    <td width="80%" height="26" valign="bottom" background="../images/tddi.gif" class="font13"> 
      <div align="right"> </div></td>
    <td width="3%" valign="top" background="../images/tddi.gif" class="font13"> 
      <div align="right"><IMG height=26 src="../images/tddir.gif"></div></td>
  </tr>
</table>
<table width="98%" height="107" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#e9ecf5">
  <tr> 
    <td height="147"  valign="top"> 
      <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="tablelsdi">
          <tr> 
            <td width="4%" background="../images/tablelb01.gif"><img src="../images/tablelb01-left.gif" width="21" height="22"></td>
            <td width="82%" background="../images/tablelb01.gif" class="font12w">部门编辑</td>
            <td width="14%" background="../images/tablelb01.gif"> <div align="right"><img src="../images/tablelb01-right.gif" width="21" height="22"></div></td>
          </tr>
        </table>
    <table width="95%" border="1" align="center" cellpadding="0" cellspacing="0" class="tablelb" style ="border-collapse :collapse ;">
      <tr style ="height :26px;">
        <td style="width :15%;background-color:#ECF4FD" class="tableleft"  align ="right"><label id="sjzx" onclick ="ChoiceDept(1)">上级部门</label>&nbsp;</td>
        <td style="width :35%;background-color:#ECF4FD" class="tableleft"><asp:TextBox ID="OrgName1" Width ="140" runat ="server" TabIndex ="2" ReadOnly="True" onclick ="ChoiceDept(1)"></asp:TextBox></td>
        <td style="width :15%;background-color:#ECF4FD" class="tableleft" align ="right" >部门名称&nbsp;</td>
        <td style="width :35%;background-color:#ECF4FD" class="tableleft"><asp:TextBox ID="DeptName1" Width ="140" runat ="server" TabIndex ="1"  onkeydown="RestrictCharacter(this)" MaxLength ="40"></asp:TextBox><asp:Label ID="tishi1" runat ="server" Text ="*" ForeColor="Red"></asp:Label></td>
      </tr>
      <tr style ="height :26px;">
        <td style ="background-color:#E1EEFD" class="tableleft" align ="right" ><label id="sjry" onclick ="GetMyPersTree(1)">负责人</label>&nbsp;</td>
        <td style ="background-color:#E1EEFD" class="tableleft">
                  <asp:TextBox ID="ChoiceName_1" runat ="server" TabIndex ="3" onclick ="GetMyPersTree(1)" Width="100px"></asp:TextBox>
                  <input type="hidden" id="HChoiceID_1" runat ="server" />
                  <input type="hidden" id="HNewChoiceID_1" runat ="server" /></td>
        <td style ="background-color:#E1EEFD" class="tableleft" align ="right" >排序号&nbsp;</td>
        <td style ="background-color:#E1EEFD" class="tableleft"><asp:TextBox ID="DOrder" Width ="140" MaxLength ="8"  onblur = "CheckNumber(this.value)"  runat ="server" TabIndex ="3"  ></asp:TextBox></td>
      </tr>
      <tr style ="height :26px;">
        <td style ="background-color:#ECF4FD" class="tableleft" align ="right" >电话&nbsp;</td>
        <td style ="background-color:#ECF4FD" class="tableleft"><asp:TextBox ID="Phone" Width ="140" MaxLength ="30" onblur="checkPhone(this)" runat ="server" TabIndex ="4"  ></asp:TextBox></td>
        <td style ="background-color:#ECF4FD" class="tableleft" align ="right" >传真&nbsp;</td>
        <td style ="background-color:#ECF4FD" class="tableleft"><asp:TextBox ID="Fax" onblur="checkPhone(this)" Width ="140" MaxLength ="30" runat ="server" TabIndex ="6"  ></asp:TextBox></td>
      </tr>
      
      <tr style ="height :26px;">
        <td style ="background-color:#E1EEFD" class="tableleft" align ="right" >邮编&nbsp;</td>
        <td style ="background-color:#E1EEFD" class="tableleft"><asp:TextBox ID="Post" Width ="140" MaxLength ="10"  runat ="server" TabIndex ="4"  onblur = "CheckNumber(this.value)" ></asp:TextBox></td>
        <td style ="background-color:#E1EEFD" class="tableleft" align ="right" >地址&nbsp;</td>
        <td style ="background-color:#E1EEFD" class="tableleft"><asp:TextBox ID="Address"  Width ="140" MaxLength ="100" runat ="server" TabIndex ="6"  ></asp:TextBox></td>
      </tr>
      <tr style ="height :26px;">
        <td style ="background-color:#ECF4FD" class="tableleft" align ="right" >网址&nbsp;</td>
        <td style ="background-color:#ECF4FD" class="tableleft"><asp:TextBox ID="Website" Width ="140" MaxLength ="50" runat ="server" TabIndex ="4"  ></asp:TextBox></td>
        <td style ="background-color:#ECF4FD" class="tableleft" align ="right" >工作组&nbsp;</td>
        <td style ="background-color:#ECF4FD" class="tableleft"><asp:TextBox ID="ComWorkGroup"  Width ="140" MaxLength ="50" runat ="server" TabIndex ="6"  ></asp:TextBox></td>
      </tr>
      <tr style ="height :26px;">
        <td style ="background-color:#E1EEFD" class="tableleft" align ="right" >
            类别&nbsp;</td>
        <td style ="background-color:#E1EEFD" class="tableleft"><asp:DropDownList ID="Type" TabIndex ="6" DataValueField ="param_value"  DataTextField ="param_name" runat="server" ></asp:DropDownList></td>
        <td style ="background-color:#E1EEFD" class="tableleft" align ="right" >组织性质&nbsp;</td>
        <td style ="background-color:#E1EEFD" class="tableleft"><asp:DropDownList ID="org_character" TabIndex ="6" DataValueField ="param_value"  DataTextField ="param_name" runat="server" ></asp:DropDownList></td>
      </tr>
      <tr style ="height :26px;">
        <td style ="background-color:#ECF4FD" class="tableleft" align ="right" >组织级别&nbsp;</td>
        <td style ="background-color:#ECF4FD" class="tableleft"><asp:DropDownList ID="org_Level" TabIndex ="6" DataValueField ="param_value"  DataTextField ="param_name" runat="server" ></asp:DropDownList></td>
        <td style ="background-color:#ECF4FD" class="tableleft" align ="right" >组织类别&nbsp;</td>
        <td style ="background-color:#ECF4FD" class="tableleft"><asp:DropDownList ID="org_Sort" TabIndex ="6" DataValueField ="param_value"  DataTextField ="param_name" runat="server" ></asp:DropDownList></td>
      </tr>
      <tr style ="height :26px;">
        <td style ="background-color:#E1EEFD" class="tableleft" align ="right" >组织类型&nbsp;</td>
        <td style ="background-color:#E1EEFD" class="tableleft"><asp:DropDownList ID="orgTypes" TabIndex ="6" DataValueField ="param_value"  DataTextField ="param_name" runat="server" ></asp:DropDownList></td>
        <td style ="background-color:#E1EEFD" class="tableleft" align ="right" >是否独立核算&nbsp;</td>
        <td style ="background-color:#E1EEFD" class="tableleft">
           <asp:dropdownlist id="IfAccount" tabIndex="7" runat="server" Enabled="true" Width="60px">			
			 <asp:ListItem Value="1" Selected ="true" >是</asp:ListItem>
			 <asp:ListItem Value="0">否</asp:ListItem>
		  </asp:dropdownlist></td>
      </tr>
      <tr style ="height :26px;">
        <td style ="background-color:#ECF4FD" class="tableleft" align ="right" >属性1&nbsp;</td>
        <td style ="background-color:#ECF4FD" class="tableleft">
            <asp:DropDownList ID="Prop1" TabIndex ="6" DataValueField ="param_no"  DataTextField ="param_name" runat="server" ></asp:DropDownList>
        </td>
        <td style ="background-color:#ECF4FD" class="tableleft" align ="right" ></td>
        <td style ="background-color:#ECF4FD" class="tableleft"></td>
      </tr>
      <tr style ="height :26px;">
        <td style ="background-color:#ECF4FD" class="tableleft"  align ="right">是否有效&nbsp;</td>
        <td style ="background-color:#ECF4FD" class="tableleft">
           <asp:dropdownlist id="Effective" tabIndex="7" runat="server" Enabled="true" Width="60px">			
			 <asp:ListItem Value="1" Selected ="true" >是</asp:ListItem>
			 <asp:ListItem Value="0">否</asp:ListItem>
		  </asp:dropdownlist>
        </td>
        <td style ="background-color:#ECF4FD" class="tableleft" align="right"><div id="DivCheckBox" style ="DISPLAY:none"><input type="checkbox" name="Continue" id="IfsaveDeptHistoryInfo" runat ="server" value="1" onclick ="if(this.checked==true){DivHistoryDesc.style.display='';} else{DivHistoryDesc.style.display='none';}"/></div></td>
        <td style ="background-color:#ECF4FD" class="tableleft"><div id="DivCheckBox2" style ="DISPLAY:none">保存历史信息</div></td>
       </tr>
       </table>       
      <div id="DivHistoryDesc" style="DISPLAY:none">
       <table width="95%" border="1" align="center" cellpadding="0" cellspacing="0" class="tablelb" style ="border-collapse :collapse ;">
         <tr>
          <td style ="width:15%;" bgcolor="#E1EEFD" class="tableleft" align="right">变更说明</td>
          <td bgcolor="#E1EEFD" class="tableleft"><asp:TextBox TextMode ="multiline" Rows ="5" Columns ="50" runat ="server" ID ="ChangeReason"></asp:TextBox></td>
         </tr>
      </table>
      </div>
      <table  width="95%" border="0" cellpadding="5" cellspacing="0" align="center" >
      <tr><td width="20%"></td>
        <td>
            <input id="GrantBtn1" type="submit" runat ="server" class="button03" tabindex ="8"  value ="提交(S)" accesskey ="s" onserverclick="GrantBtn1_ServerClick" /> &nbsp;&nbsp;
            <input type ="button" id="backBtn"  value ="返回(C)" accesskey ="c" class="button03" tabindex ="9" onclick ="window.close();" /></td>
      </tr>
    </table>
    <input type="hidden" id="hOrgID1" runat ="server"  />
    <input type="hidden" id="hNewOrgID1" runat ="server" />
    <input type="hidden" id="hOldOrgName" runat ="server" />
          <input type="hidden" id="hOldParentID1" runat ="server"  />
          <input type="hidden" id="hNewParentID1" runat ="server"  />
          <input type="hidden" id="hidEditType" runat ="server" />
          <input type="hidden" id="hEffective" runat ="server" />
          <input type="hidden" id="hPersID1" runat ="server" />          
          <input type="hidden" id="NewPersID1" runat="server" />
          <input type="hidden" id="HOrgType" runat ="server"  />
          <input type="hidden" id="hParentChildIDCol" runat ="server" />
    </form>
    <script language ="javascript" type ="text/javascript" >
     <!--
      //部门选择
      var iTem;
      var sDeptInfo;
      var iNumber1 = 1;    //0表示任意多,其它的正整数为可以选择的最大个数.不可以为负数
   function ChoiceDept(subtype)
      {
            iTem = subtype;        
            var sFeatures = "dialogHeight:500px;dialogWidth:400px;resizeable:no;help:no;status:no";
            if(iTem == 1)
            {
               var obj = showModalDialog("SelectOtherOrgInfo.aspx?OrgType="+form1.HOrgType.value+"&ParentChildID="+form1.hParentChildIDCol.value,window,sFeatures);
               if(obj != undefined)
               {
                  sDeptInfo = obj.sDeptInfo;
                  ChangeValue(sDeptInfo,1);
               }   
            }
       }        
    function ChangeValue(sDInfo,iNo)
    {
           var cDeptID = "";
           var cDeptName = "";
           var cParentID = "";
           var DeptInfo = sDInfo.split('|'); // ID,Name,ParentID,ChildNumber,PersNumber,DOrder,Phone,Principal,PrincipalName,Fax,Effective,PrentName
           nDeptID=DeptInfo.length;               
           for(j=0;j<nDeptID-1;j++)
           {
             var sStr1=DeptInfo[j];
             var ary1  = sStr1.split(",");
             cDeptID += ary1[0]+",";
             cDeptName += ary1[1]+",";
             cParentID += ary1[2]+",";
           }
          eval("form1.hNewParentID"+iNo+".value=\""+cDeptID+"\";");          
          eval("form1.OrgName"+iNo+".value=\""+cDeptName+"\";");
          eval("form1.hNewOrgID"+iNo+".value=\""+cDeptID+"\";");
    }      
  -->
</script>
    
    <script language ="javascript" type="text/javascript" >
    <!--
      var sData = dialogArguments;
      form1.hidEditType.value = sData.stype ;
      var sobj = sData.OrgForm.Hcode.value;  
      var ary=sobj.split('|');
      if(sData.stype == "2")  // 2 修改 1 新建
      {
        DivCheckBox.style.display='';
        DivCheckBox2.style.display='';
        form1.DeptName1.value = trim(ary[1]);
        form1.hOldOrgName.value = trim(ary[1]);
        form1.DOrder.value = trim(ary[5]);
        form1.Phone.value = trim(ary[6]);
        if(ary[7] !="0" && ary[7] !="")
        {
            form1.HChoiceID_1.value = ary[7]+",";
        }
        else
        {
            form1.HChoiceID_1.value = "";
        }
        form1.ChoiceName_1.value = trim(ary[8]);
        form1.Fax.value = trim(ary[9]);
        form1.Effective.value = trim(ary[10]);
        var PName = "";
        if(trim(ary[11]) == "" || trim(ary[11]) == null)
        {
          PName = "当前组织为顶级组织";
        }
        else
        {
          PName = trim(ary[11]);
        }
        form1.OrgName1.value       = PName;
        form1.Post.value = trim(ary[13]);
        form1.Address.value = trim(ary[14]);
        form1.Website.value = trim(ary[15]);
        form1.ComWorkGroup.value = trim(ary[16]);        
        form1.Type.value = trim(ary[17]);
        form1.org_character.value = trim(ary[18]);
        form1.org_Level.value = trim(ary[19]);
        form1.org_Sort.value = trim(ary[20]);
        form1.orgTypes.value = trim(ary[21]);
        form1.IfAccount.value = trim(ary[22]);
        form1.Prop1.value = trim(ary[23]);
      }
      else if(sData.stype == "1")
       {
          if(trim(ary[1]) == "" || trim(ary[1]) == null || trim(ary[1]) == "undefined")
          {
            form1.OrgName1.value = "当前组织为顶级组织";
          }
          else
          {
            form1.OrgName1.value = trim(ary[1]);
          }               
       }      
        var soPID;
        
        form1.hOrgID1.value        = trim(ary[0])+",";
        form1.hNewOrgID1.value     = trim(ary[0])+",";
         if(trim(ary[2]) == "" || trim(ary[2]) == null || trim(ary[2]) == "undefined")
        {
            soPID = "0";
        }
        else
        {
          form1.hOldParentID1.value  = trim(ary[2])+",";  //原先的上级组织ID
          form1.hNewParentID1.value  = trim(ary[2])+",";  //新的上级组织ID  此功能在修改模式下,用户可以选择修改上级组织时生效.  
        }   
   -->
    </script>    
</body>
</html>
